<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-if-v-show</title>
</head>

<body>
    <div id="app">
      <div v-if="flag">从一而终</div>
      <div v-show="flag">反复无常</div>
      <input type="button" value="隐藏/显示" @click="flag=!flag">
    </div>
    <script src="js/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                flag:true, //标记，表示是否展示
            }
        })
    </script>
</body>

</html>